local Module = require "core.Module"

---@alias ServiceName "HOT_MGR" | "LOGGER" | "GATE_MASTER" | "MONGO_POOL" | "API_MASTER" | "PLAYER_MGR" | "EVENT_MGR"

local M = {
    -- 基础服务
    HOT_MGR = ".HOT_MGR",
    GAME_LOGGER = ".GAME_LOGGER",
    GATE_MASTER = ".GATE_MASTER",
    MONGO_POOL = ".MONGO_POOL",
    API_MASTER = ".API_MASTER",
    PLAYER_MGR = ".PLAYER_MGR",
    EVENT_MGR = ".EVENT_MGR",
}

local function moduleName(mod)
    return string.upper(string.gsub(mod, "(%a)(%u)", "%1_%2"))
end

-- 游戏模块服务
local function initModule(mod)
    -- 将mod改成全大写，用 _ 分割单词的形式
    local name = moduleName(mod)
    M[name] = "." .. name
end

function M.getModuleName(mod)
    return moduleName(mod)
end

Module.foreach(initModule)

return M
